//
//  GYShopFirstCollectionViewCell.m
//  GoodLuck
//
//  Created by apple on 2018/2/28.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

#import "GYShopFirstCollectionViewCell.h"

@interface GYShopFirstCollectionViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *leftImageView;
@property (weak, nonatomic) IBOutlet UIImageView *rightTopImageView;
@property (weak, nonatomic) IBOutlet UIImageView *rightBottonImageView;

@end
@implementation GYShopFirstCollectionViewCell


- (void)awakeFromNib {
    [super awakeFromNib];
    UITapGestureRecognizer *leftTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(leftTapGR:)];
    [self.leftImageView addGestureRecognizer:leftTap];
    
    UITapGestureRecognizer *rightTop = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(rightTopGR:)];
    [self.rightTopImageView addGestureRecognizer:rightTop];
    
    UITapGestureRecognizer *rightBottom = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(rightBottomGR:)];
    [self.rightBottonImageView addGestureRecognizer:rightBottom];
    
}

- (void)leftTapGR:(UITapGestureRecognizer *)sender {
    NSString *square_type = [self.homeDic objectForKey:@"square_type"];
    NSString *square_data = [self.homeDic objectForKey:@"square_data"];
    self.homeCallBack(square_type,square_data);
}

- (void)rightTopGR:(UITapGestureRecognizer *)sender {
    NSString *rectangle1_type = [self.homeDic objectForKey:@"rectangle1_type"];
    NSString *rectangle1_data = [self.homeDic objectForKey:@"rectangle1_data"];
    self.homeCallBack(rectangle1_type,rectangle1_data);
}

- (void)rightBottomGR:(UITapGestureRecognizer *)sender {
    NSString *rectangle2_type = [self.homeDic objectForKey:@"rectangle2_type"];
    NSString *rectangle2_data = [self.homeDic objectForKey:@"rectangle2_data"];
    self.homeCallBack(rectangle2_type,rectangle2_data);
}



- (void)setHomeDic:(NSDictionary *)homeDic {
    _homeDic = homeDic;
    
    //赋值
    [self.leftImageView sd_setImageWithURL:[NSURL URLWithString:[homeDic objectForKey:@"square_image"]] placeholderImage:[UIImage imageNamed:@"4"]];
    
    [self.rightTopImageView sd_setImageWithURL:[NSURL URLWithString:[homeDic objectForKey:@"rectangle1_image"]] placeholderImage:[UIImage imageNamed:@"4"]];
    
    [self.rightBottonImageView sd_setImageWithURL:[NSURL URLWithString:[homeDic objectForKey:@"rectangle2_image"]] placeholderImage:[UIImage imageNamed:@"4"]];
    
}
@end
